﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
    <script src="ext/ext-all-dev.js" type="text/javascript"></script>
    <script src="ext/ext-lang-es.js" type="text/javascript"></script>

    <script src="MyApp/models/Invoice.js" type="text/javascript"></script>
    <script src="MyApp/store/Invoices.js" type="text/javascript"></script>
    <script type="text/javascript">
        Ext.onReady(function () {

            //var store = Ext.create('MyApp.store.Invoices');
            //store.load(function () {
                
            //    store.each(function (record) {
            //        console.log(record.get('name'));
            //        //console.log('que pacho?');
            //    });

            //});

            var store = Ext.create('MyApp.store.Invoices');

            store.load({
                callback: function () {
                    var model1 = Ext.create('MyApp.models.Invoice', {
                        taxId: 'JO-7669',
                        name: 'Cesar Bocaflox',
                        address: 'LA MOLINA - LIMA - PERU',
                        creditCard : '123456789123456'
                    });

                    var model2 = Ext.create('MyApp.models.Invoice', {
                        taxId: 'A4G-487',
                        name: 'Cesar Bocanegra La Matta',
                        address: 'LA MOLINA - LIMA - PERU',
                        creditCard: '12300045006789123456'
                    });

                    store.add([model1, model2]);
                    store.removeAt(0);
                    store.sync();
                   
                }
            });

        });
    </script>
    <title></title>
</head>
<body>

</body>
</html>
